/*
 * Describe how you could use a single array to implement three stacks
 */
package Chapter3;

public class Chapter3_1 {
	class StackNode{
		int value;
		int previous;
		
		public StackNode(int v, int p)
		{
			value = v;
			previous = p;
		}
		
		public StackNode(int v)
		{
			value = v;
			previous = -1;
		}
	}
	
	int ARRAY_SIZE = 256;
	int lastIndex = 0;
	StackNode stackBase[] = new StackNode[ARRAY_SIZE];
	int stackTop[] = new int[3];
	
	public void push(int value, int index)
	{
		StackNode node = new StackNode(value, stackTop[index]);
		if(stackTop[index] < 0) //this stack is empty
		{
			//add the new node to the end of existing nodes
			stackBase[lastIndex] = node;
			lastIndex++;
		}
		else //this stack is not empty
		{
			
		}
	}
	
	public StackNode pop(int index)
	{
		return null;
	}
}
